package cn.cqautotest.cqviehelper.ui.fragment;

import android.annotation.SuppressLint;
import android.view.View;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import cn.cqautotest.cqviehelper.R;
import cn.cqautotest.cqviehelper.adapters.ChatAdapter;
import cn.cqautotest.cqviehelper.base.BaseActivity;
import cn.cqautotest.cqviehelper.base.BaseFragment;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

@SuppressLint("NonConstantResourceId")
public class AiChatFragment extends BaseFragment<BaseActivity> {

    @BindView(R.id.recyclerView)
    RecyclerView mRecyclerView;
    private ChatAdapter mChatAdapter;
    private final List<String> mMessageList = new ArrayList<>();

    public static AiChatFragment getInstance() {
        return new AiChatFragment();
    }

    @Override
    protected int getLayoutResId() {
        return R.layout.fragment_ai_chat;
    }

    @Override
    protected void initView(View rootView) {
        mChatAdapter = new ChatAdapter();
        mRecyclerView.setLayoutManager(new LinearLayoutManager(mContext));
        mRecyclerView.setAdapter(mChatAdapter);
    }

    @Override
    protected void initData() {
        mMessageList.add("我是最闪耀的星星~");
        mMessageList.add("Java是一种为多个平台生成软件的编程语言。由Sun Microsystems的前计算机科学家James A. Gosling在20世纪90年代中期开发的。编译的代码可在大多数操作系统上运行。");
        mMessageList.add("Java，是于1995年5月被推出的Java程序设计语言和Java平台的总称。");
        mMessageList.add("C语言是一门通用计算机编程语言,广泛应用于底层开发。");
        mChatAdapter.setObjects(mMessageList);
    }
}
